import mimetypes
import os
from django.http import HttpResponse
from Friend.models import Friend
from History.models import History
from Message.models import Message
from User.models import User
def handelFile(request, path):
    type, encoding = mimetypes.guess_type(path)
    return HttpResponse(open("files/" + path, "rb"), content_type=type)
def dropAll(request):
    Friend.objects.all().delete()
    History.objects.all().delete()
    Message.objects.all().delete()
    User.objects.all().delete()
    names = os.listdir('files/icon/')
    for name in names:
        os.remove("files/icon/" + name)
    return HttpResponse("12345678")